import request from '@u/request'
// 请求商品列表
const fetchItems = (params = {}) => {
  return request.get("/getItemLists", {params})
}

// 批量新增商品 /addItems
const addItems = (params= {}) => {
  return request.post('/addItems', params)
}
// 新增商品
const addItem = (params= {}) => {
  return request.post('/addItem', params)
}
// 商品详情 /getItemDetail
const fetchItemDetail = (id: any) => {
  return request.get("/getItemDetail", {params: {id}})
}
// 修改商品
const updateItem = (params = {}) => {
  return request.put('/updateItem', params)
}
// 删除商品
const delItem = (id:number) => {
  return request.delete("/delItem", {params: {id}})
}
export {
  fetchItems,
  addItems,
  addItem,
  fetchItemDetail,
  updateItem,
  delItem
}